home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / exec31.arc / CHECKPAT.H < prev    next >
C/C++ Source or Header  |  1991-08-25  |  2KB  |  63 lines

  1. /*
  2.     --- Version 3.1 91-08-17 23:07 ---
  3.  
  4.    CHECKPAT.H: Path check function header file.
  5.  
  6.    Public domain software by
  7.  
  8.         Thomas Wagner
  9.         Ferrari electronic GmbH
  10.         Beusselstrasse 27
  11.         D-1000 Berlin 21
  12.         Germany
  13. */
  14.  
  15. #ifdef __cplusplus
  16. extern "C" int
  17. #else
  18. extern int _cdecl
  19. #endif
  20. checkpath (char *string,     /* Input file name string */
  21.            char *drive,      /* Drive letter and colon */
  22.            char *dir,        /* \directory\ */
  23.            char *fname,      /* file name */
  24.            char *ext,        /* .extension */
  25.            char *fullpath);  /* combined path */
  26.  
  27. /*
  28.    This routine accepts a file name and path, checks and resolves the
  29.    path, and splits the name into its components.
  30.  
  31.    A relative path, or no path at all, is resolved to a full path
  32.    specification. An invalid disk drive will not cause the routine 
  33.    to fail.
  34. */
  35.  
  36. /* Error returns: */
  37.  
  38. #define ERR_DRIVE       -1    /* Invalid drive */
  39. #define ERR_PATH        -2    /* Invalid path */
  40. #define ERR_FNAME       -3    /* Malformed filename */
  41. #define ERR_DRIVECHAR   -4    /* Illegal drive letter */
  42. #define ERR_PATHLEN     -5    /* Path too long */
  43. #define ERR_CRITICAL    -6    /* Critical error (invalid drive) */
  44.  
  45. /* Good returns (values ORed): */
  46.  
  47. #define HAS_WILD        1     /* Filename/ext has wildcard characters */
  48. #define HAS_EXT         2     /* Extension specified */
  49. #define HAS_FNAME       4     /* Filename specified */
  50. #define HAS_PATH        8     /* Path specified */
  51. #define HAS_DRIVE       0x10  /* Drive specified */
  52. #define FILE_EXISTS     0x20  /* File exists, upper byte has attributes */
  53. #define IS_DIR        0x1000  /* Directory, upper byte has attributes */
  54.  
  55. /* The file attributes returned if FILE_EXISTS or IS_DIR is set */
  56.  
  57. #define IS_READ_ONLY 0x0100
  58. #define IS_HIDDEN    0x0200
  59. #define IS_SYSTEM    0x0400
  60. #define IS_ARCHIVED  0x2000
  61. #define IS_DEVICE    0x4000
  62.  
  63.